//浏览器 服务器端
let path = require('path');
let merge=require('webpack-merge');
let base=require('./webpack.base');
let nodeExternals=require('webpack-node-externals');
module.exports=merge(base,{
	target: 'node',//打包的是服务器端node文件
	entry: path.resolve(__dirname,'./src/server/index.js'),
	output:{
		path:path.resolve(__dirname,'build'),
		filename:'server.js'
	},
	externals: [nodeExternals()],
	module:{
		rules:[
			{
				test: /\.css$/,
				use: [
					'isomorphic-style-loader',
					{
						loader: 'css-loader',
						options: {
							modules: true,
							localIdentName:'[name]_[local]_[hash:base64:5]'
						}
					}
				]
			}
		]
	}
	
});
